package cn.xianyang.controller;

import cn.xianyang.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    //查看应用端口
    @Value("${server.port}")
    private Integer port;

    /**
     * 订单服务来调用
     * @param id
     * @return
     */
    @GetMapping("/getById/{id}")
    public User getById(@PathVariable("id") long id){
        return new User(id,"大山","大山很强大"+port);
    }

}
